﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admincp/Site.master" AutoEventWireup="true" CodeFile="Suppliers.aspx.cs" Inherits="admincp_Suppliers" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style>
        .layout {
            background:#43b51f;
        }
        .layout h2 { margin-left: 40px; padding-left: 0.1em; font-size: 2em; line-height: 1em; font-size:40px;
			font-family: Arial, Helvetica, sans-serif;
			color: #504f4f;
			text-shadow: 0px 2px 1px #333;
        }
        .manager {
            clear: both;
            width: 100%;
            margin-left: 20px;
            width:950px;
            padding-bottom:10px;
        }
        footer {
            clear:both;
            text-align:right;
            padding-top:30px;
            padding-bottom:20px;
            background:#0d0d0d;
        }
        .auto-style1 {
            width: 199px;
        }
        .auto-style2 {
            width: 178px;
        }
        .auto-style3 {
            width: 264px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2>Trang Quản Lý Nhà Cung Cấp</h2>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
        <ProgressTemplate>
            Đang xử lý dữ liệu...
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="manager">
                <asp:Panel ID="pnCategory" runat="server" GroupingText="Mục Nhập Thông Tin Nhà Cung Cấp">
                    <table>
                        <tr>
                            <td class="auto-style2">Tên Nhà Cung Cấp</td>
                            <td><asp:TextBox ID="txtContactName" Width="130" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvContactName" runat="server" ControlToValidate="txtContactName" Display="Dynamic" ErrorMessage="Tên chủ đơn vị cung cấp không được rỗng" SetFocusOnError="True" >*</asp:RequiredFieldValidator>
                        
                            </td>
                             <td>Quan Hệ</td>
                            <td><asp:TextBox ID="txtContactTitle" Width="130" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvContactTitle" runat="server" ControlToValidate="txtContactTitle" Display="Dynamic" ErrorMessage="Chức vụ chủ đơn vị cung cấp không được rỗng" SetFocusOnError="True" >*</asp:RequiredFieldValidator>
                        
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style2">Địa Chỉ</td>
                            <td><asp:TextBox ID="txtAddress" Width="130" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvAddress" runat="server" ControlToValidate="txtAddress" Display="Dynamic" ErrorMessage="Địa chỉ công ty đối tác không được rỗng" SetFocusOnError="True" >*</asp:RequiredFieldValidator>
                        
                            </td>
                            <td>Thành Phố</td>
                            <td><asp:TextBox ID="txtCity" Width="130" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvCity" runat="server" ControlToValidate="txtCity" Display="Dynamic" ErrorMessage="Thành phố không được rỗng" SetFocusOnError="True" >*</asp:RequiredFieldValidator>
                        
                            </td>
                            <td>Mã bưu chính</td>
                            <td class="auto-style3"><asp:TextBox ID="txtPostalCode" Width="130" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvPostalCode" runat="server" ControlToValidate="txtPostalCode" Display="Dynamic" ErrorMessage="Mã bưu chính không được rỗng" SetFocusOnError="True" >*</asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revPostalCode" runat="server" ControlToValidate="txtPostalCode" Display="Dynamic" ErrorMessage="Không nhập ký tự đặt biệt" ValidationExpression="[0-9]{0,}"  SetFocusOnError="True">*</asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style2">Quốc Gia</td>
                            <td><asp:TextBox ID="txtCountry" Width="130" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvCountry" runat="server" ControlToValidate="txtCountry" Display="Dynamic" ErrorMessage="Tên quốc gia không được rỗng" SetFocusOnError="True" >*</asp:RequiredFieldValidator>
                        
                            </td>
                            <td>Điện thoại</td>
                            <td><asp:TextBox ID="txtPhone" Width="130" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvPhone" runat="server" ControlToValidate="txtPhone" Display="Dynamic" ErrorMessage="Điện thoại liên lạc không được rỗng" SetFocusOnError="True" >*</asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revPhone" runat="server" ControlToValidate="txtPhone" Display="Dynamic" ErrorMessage="Không nhập ký tự đặt biệt" ValidationExpression="[0-9]{0,}"  SetFocusOnError="True">*</asp:RegularExpressionValidator>
                            </td>
                            <td>Trang Chủ</td>
                            <td class="auto-style3"><asp:TextBox ID="txtHomePage" Width="130" runat="server" />
                        
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style2">Trạng thái</td>
                            <td colspan="5" align="left">
                                <asp:RadioButtonList ID="rbtnStatus" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Enabled="true" Selected="True" Text="Hiện" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Ẩn" Value="0" />
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                    </table>
                </asp:Panel><br />
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" /><br />
                <asp:Button ID="btnInsert" Text="Thêm Mới" runat="server" OnClick="btnInsert_Click" />&nbsp;
                <asp:Button ID="btnUpdate" Text="Cập Nhật" runat="server" OnClick="btnUpdate_Click" />
                <br />
                <br />
                <asp:GridView ID="gvSuppliers" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" Width="947px" OnSelectedIndexChanging="gvSuppliers_SelectedIndexChanging" AllowPaging="true" OnPageIndexChanging="gvSuppliers_PageIndexChanging" OnRowDeleting="gvSuppliers_RowDeleting" PageSize="5">
                    <Columns>
                        <asp:BoundField HeaderText="STT" DataField="id" />
                        <asp:BoundField HeaderText="Tên NCC" DataField="contactname" />
                        <asp:BoundField HeaderText="Quan hệ" DataField="contacttitle" />
                        <asp:BoundField HeaderText="Địa Chỉ" DataField="address" />
                        <asp:BoundField HeaderText="Phone" DataField="phone" />
                        <asp:TemplateField HeaderText="Trạng Thái">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("status") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# ((Eval("status").ToString()=="True")?"Hiện":"Ẩn") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:CommandField SelectText="Sửa" ShowSelectButton="True" />
                        <asp:CommandField DeleteText="Xoá" ShowDeleteButton="true" />
                    </Columns>
                    <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                    <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                    <RowStyle BackColor="White" ForeColor="#330099" VerticalAlign="Top" />
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                    <SortedAscendingCellStyle BackColor="#FEFCEB" />
                    <SortedAscendingHeaderStyle BackColor="#AF0101" />
                    <SortedDescendingCellStyle BackColor="#F6F0C0" />
                    <SortedDescendingHeaderStyle BackColor="#7E0000" />
                </asp:GridView><br />

            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    
</asp:Content>

